<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">

	var str ="dhdUdfsjha";

	function strChange (str) {

		var newstr = '';

		for (var i = 0; i < str.length; i++) {
			
			if(str[i]==str[i].toUpperCase()){
				newstr += str[i].toLowerCase();
			}else{
				newstr += str[i].toUpperCase();
			}
		};
		return newstr;
	}

	var res = strChange(str);

	// document.write(res);



	var  str = "参数：表示字符串中学并思某个位置的数字，即字符在字符串中的下学并思标,参数：表示字符串中某个位置的数字，即字符在字符串中的下标,参数：表示字符串中某个位置的数字，即字学并思马志斌符在字符串中的下学并思标,参数：表示字符串学并思中某个位置的数字，即字符在字符串中的下标,";


	var on =true;

	var index = 0;

	while(on){

		index = str.indexOf("学并思",index);

		if(index==-1){
			on = false;
			break;
		}

		// document.write(index+"<br>");

		index++;
	}



	var arr = [];

	for (var i = 0; i < 7; i++) {

		var num = Math.round(Math.random()*(47-1)+1);

		var is_input =true;

		for (var j = 0; j < arr.length; j++) {
			if(arr[j]==num){
				is_input=false;
				i --;
			}
		};
		
		if(is_input){
			arr.push(num);
		}
	};

	// document.write(arr);
	


	// var now = Math.round(((new Date()).getTime())/1000);

	var nowObj = new Date();
	var nowtime = nowObj.getTime()/1000;
	var now = Math.round(nowtime);

	var ydObj = new Date("2018-01-01 0:0:0");
	var ydtime = ydObj.getTime()/1000;
	var yd = Math.round(ydtime);

	var diff = yd-now;

	var day = Math.floor(diff/86400);

	var yushu = diff%86400;

	var hours =  Math.floor(yushu/3600);

	var yushu = yushu%3600;

	var min =  Math.floor(yushu/60);

	var second =  yushu%60;

	document.write(day+"天"+hours+"小时"+min+"分钟"+second+"秒");





	







	</script>
</head>
<body>
	
</body>
</html>